

// 引入需要的模块
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'

const routes = [

  {
    path: '/',
    name: 'index',
    redirect: '/dataBoard',
    component: () => import('@/views/Index/Index.vue'),
    children: [
      {
        path: '/dataBoard',
        name: 'DataBoard',
        component: () => import('@/views/dataBoard/index.vue'),
        meta: { title: '数据看板', isshow: true, icon: 'form', activeInx: 0, }
      },
      {
        path: '/resourceManagement',
        name: 'ResourceManagement',
        meta: {
          title: '资源管理',
          isshow: true,
          activeInx: 1,
        },
        component: () => import('@/views/resourceManagement/index.vue'),
      },
      
      {
        path: '/account',
        name: 'Account',
        meta: {
          title: '业务台账',
          isshow: true,
          activeInx: 2,
        },
        component: () => import('@/views/account/index.vue'),
      },
      {
        path: '/contract',
        name: 'Contract',
        meta: {
          title: '合同管理',
          isshow: true,
          activeInx: 6,
        },
        component: () => import('@/views/contract/index.vue'),
      },
    
      {
        path: '/transferStation',
        name: 'TransferStation',
        meta: {
          title: '中转站管理',
          isshow: true,
          activeInx: 4,
        },
        component: () => import('@/views/transferStation/index.vue'),
      },
      {
        path: '/collectionPoint',
        name: 'CollectionPoint',
        meta: {
          title: '收集点管理',
          isshow: true,
          activeInx: 3,
        },
        component: () => import('@/views/collectionPoint/index.vue'),
      },
      {
        path: '/trafficManagement',
        name: 'trafficManagement',
        meta: {
          title: '车辆管理',
          isshow: true,
          activeInx: 5,
        },
        component: () => import('@/views/trafficManagement/index.vue'),
      },
    ]
  },
  {
    path: "/login",
    component: () => import("@/views/login/index.vue"),
    hidden: true,
  },

  {
    path: "/404",
    component: () => import("@/views/404.vue"),
    hidden: true,
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  scrollBehavior: () => ({ top: 0 }),
  routes: routes
})

export default router
